<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- 导入layui的css -->
    <link rel="stylesheet" href="../assets/lib/layui/css/layui.css" />
    <!-- 导入 `cropper.css` 样式表 -->
    <link rel="stylesheet" href="../assets/lib/cropper/cropper.css">
    <!-- 导入自己的pwd.css -->
    <link rel="stylesheet" href="../assets/css/user/user_avatar.css" />
</head>

<body>
    <!-- 卡片区域 -->
    <div class="layui-card-header">更换头像</div>
    <div class="layui-card-body">
        <!-- 第一行 预览区域和裁剪区域 -->
        <div class="row1">
            <!-- 裁剪区域 -->
            <div class="cropper-box">
                <!-- 这个标签很重要要初始化为预览区域 -->
                <img src="../assets/images/sample.jpg" alt="" id='image'>
            </div>
            <!-- 预览区域 -->
            <div class="preview-box">
                <!-- 100x100 -->
                <div>
                    <div class='img-preview w100'></div>
                    <p class='size'>100 x 100</p>
                </div>
                <!-- 50x50 -->
                <div>
                    <div class='img-preview w50'></div>
                    <p class='size'>50 x 50</p>
                </div>
            </div>
        </div>
        <!-- 第二行 上传和确定区域 -->
        <div class="row2">
            <input type="file" id='file' accept='image/png,image/jpeg'>
            <button type='button' class='layui-btn' id='btnChooseImage'>上传</button>
            <button type='button' class='layui-btn layui-btn-danger' id='btnSureImage'>确定</button>
        </div>
    </div>
    </div>
    <!-- 导入 layui 的 js -->
    <script src="../assets/lib/layui/layui.all.js"></script>
    <!-- 导入 jQuery -->
    <script src="../assets/lib/jquery.js"></script>
    <!-- 导入cropper.js -->
    <script src="/assets/lib/cropper/Cropper.js"></script>
    <script src="/assets/lib/cropper/jquery-cropper.js"></script>
    <!-- 导入 baseAPI -->
    <script src="../assets/js/baseAPI.js"></script>
    <!-- 导入自己的 js -->
    <script src="../assets/js/user/user_avatar.js"></script>
</body>

</html>